package day06.bankAccount;

import java.util.Scanner;

public class BankAccountTest {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入账户余额");
        BankAccount account=new BankAccount(sc.nextInt());
        System.out.println("请输入操作数");
        int number= sc.nextInt();
        while(number>0) {
        System.out.println("请输入操作d表示存款，w表示取款，以及数量");
        String c= sc.next();int n= sc.nextInt();
        if(c.equals("d")){
            account.deposit(n);
            System.out.println("balance:"+account.getbalance());
        }else if(c.equals("w")){
            account.withdraw(n);
            System.out.println("balance:"+account.getbalance());
        }
        number--;
        }

    }
}
